package cRedis

const (
	RedisConfigName = "RedisConf"

	DefaultClient = "default"
)

type RedisConf struct {
	Clients map[string]*RedisConf_Client `json:"clients"`
}

type RedisConf_Client struct {
	Host         string                 `json:"host"`
	Port         int64                  `json:"port"`
	Auth         string                 `json:"auth"`
	DB           int64                  `json:"db"`
	Retries      int64                  `json:"retries"`
	DialTimeout  int64                  `json:"dial_timeout"`
	ReadTimeout  int64                  `json:"read_timeout"`
	WriteTimeout int64                  `json:"write_timeout"`
	Pool         *RedisConf_Client_Pool `json:"pool"`
}

type RedisConf_Client_Pool struct {
	Size         int64 `json:"size"`
	MinIdleConns int64 `json:"min_idle_conns"`
	PoolTimeout  int64 `json:"pool_timeout"`
	IdleTimeout  int64 `json:"idle_timeout"`
}

func (i *RedisConf) ConfigName() string {
	return RedisConfigName
}

var redis_config = &RedisConf{
	Clients: map[string]*RedisConf_Client{},
}
